<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>图书</title>
    <link rel="stylesheet" href="/Public/layui/css/layui.css"  media="all">
    <style>
        .layui-input-block input{
            width:250px;
        }

    </style>
</head>
<body>

    <!--<form class="" action="#">-->
        <div class="layui-form-item">
            <label class="layui-form-label">快递单号:</label>
            <div class="layui-input-block">
                <input id="kuaidi_sn" type="text" name="kuaidi_sn" class="layui-input" value="<?php echo ($list["kuaidi_sn"]); ?>">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">快递公司:</label>
            <div class="layui-input-block">
                <input id="kuaidi_com" type="text" name="kuaidi_com" class="layui-input" value="<?php echo ($list["kuaidi_com"]); ?>">
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button data-id="<?php echo ($res["id"]); ?>" id="updateGoods" class="layui-btn" >立即提交</button>
            </div>
        </div>
        <input id="id" type="hidden" value="<?php echo ($list["id"]); ?>">
    <!--</form>-->
    <script type="text/javascript">
        // var editor = UE.getEditor('container');
    </script>
    <script src="/Public/layui/layui.js" charset="utf-8"></script>
    <script src="/Public/js/jquery-1.11.1.min.js" charset="utf-8"></script>
    <script type="text/javascript">
        layui.use(['element','laypage','layer'], function(){
            var element = layui.element
                ,$ = layui.jquery
                ,layer = layui.layer
                ,laypage = layui.laypage;
            var count = $("#count").val();

            $("#updateGoods").on('click', function(event) {
                var id = $(this).data('id');
                // alert(id)

                var kuaidi_sn = $('#kuaidi_sn').val();
                var kuaidi_com = $('#kuaidi_com').val();
                $.ajax({
                    url:'<?php echo U("querenfahuo");?>',
                    data:{"kuaidi_sn":kuaidi_sn,"kuaidi_com":kuaidi_com,"id":id},
                    type:'post',
                    dataType:'json',
                    success:function(d){
                        layer.alert(d);
                        if(1 == d){
                            layer.alert('发货成功');
                            setTimeout(function(){
                                window.parent.location.reload();
                                var index = parent.layer.getFrameIndex(window.name);
                                parent.layer.close(index);
                            },2000);
                        }else{
                            layer.alert('发货失败');
                        }
                    }
                })
            });
            $(".fahuo").on('click', function(event) {
                var id = $(this).data('id');
                layer.open({
                    type: 2,
                    title: '确认发货',
                    shadeClose: true,
                    shade: false,
                    maxmin: true, //开启最大化最小化按钮
                    area: ['300px', '300px'],
                    content: '<?php echo U("fahuo");?>?id='+ id
                });
            });
        });
    </script>
</body>
</html>